#!/usr/bin/perl -w

package Purl::Attribute;

use strict;
use Exporter;
our @ISA = qw(Exporter);

sub new {
   my ($class, @params) = @_;
   my $self = {};
   bless $self, ref($class) || $class;

   $self->_initialize(\@params);
   $self;
}

sub _initialize {
   my $self = shift;
   my ($enactor, $created, $created_by, $owner, $value) = shift;
   $self->{enactor} = $enactor;
   $self->{created} = $created || time;
   $self->{created_by} = $created_by || $enactor;
   $self->{owner} = $owner;
   $self->{value} = $value;
}

sub value {
   my $self = shift;
   if (@_) { $self->{value} = shift }
   return $self->{value};
}

sub owner {
   my $self = shift;
   if (@_) { $self->{owner} = shift }
   return $self->{owner};
}

sub enactor {
   my $self = shift;
   if (@_) { $self->{enactor} = shift }
   return $self->{enactor};
}

sub created {
   my $self = shift;
   return $self->{created};
}

sub created_by {
   my $self = shift;
   return $self->{created_by};
}

1;
